package com.beiding.t;

import com.beiding.editanalyzeframe.AnalyseLine;
import com.beiding.editanalyzeframe.Doc;
import com.beiding.editanalyzeframe.LineStatus;
import com.beiding.jsonanalyzer.Analyzer;

import java.io.File;
import java.util.List;

/**
 * @author 丁常磊
 * @date 2021/12/8 17:53
 */

public class 比较Json {
    public static void main(String[] args) {

        Analyzer load = Analyzer.load(new File("C:\\Users\\lenovo\\Desktop\\文件\\8d8afb25-4dfa-47d3-a20b-01a5295d5ea3.json"));

        String test = load.getString("测试");
        String prod = load.getString("生产");

//        Doc td = Doc.read(test, "\n").forEachLine(line -> {
//            line.changeText(line.getText().trim());
//        });
//
//        Doc pd = Doc.read(prod, "\n").forEachLine(line -> {
//            line.changeText(line.getText().trim());
//        });
//
//        List<AnalyseLine> analyse = td.analyse(pd);
//        for (AnalyseLine analyseLine : analyse) {
//            if (analyseLine.getStatus() != LineStatus.SAME) {
//                System.out.println("差异:" + analyseLine.getStatus());
//                System.out.println(analyseLine.getSourceLine());
//                System.out.println(analyseLine.getTargetLine());
//            }
//        }

    }
}
